package server;

import gameState.Player;

import java.io.Serializable;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;



public class ServerComunicateImpl extends UnicastRemoteObject implements Remote, Serializable, ServerComunicateInterface{

    private static final long serialVersionUID = 654321L;
    private static int id = 0;

    protected ServerComunicateImpl() throws RemoteException {
    }


    
      
    public void registration(Player c) throws RemoteException {
//		System.out.println("[Registration] Ricevuta richiesta remota da "+c.getIp());
		
		Server s = Server.getInstance();
		c.setId(id);
		id++;
		s.addToRing(c);

                s.showOnScreen();
                s.keyboardListener();
    }
    
    
	
}
